package gui;


	import javax.swing.*;



	public class whichdecimalplacegui {
	public static void main (String[] args)
	{
		Number numb = new Number();
	Whichdecimalplace number = new Whichdecimalplace(numb.numberGenerator2());

	 String[] choices = { "tenths", "hundredths", "thousandths", "ten-thousandths"};
	    String input = (String) JOptionPane.showInputDialog(null, "Choose what decimal place to work on...",
	        null, JOptionPane.QUESTION_MESSAGE, null, choices, choices[0]);
	    
	    if (input == "tenths"){
	    String ans;
	        ans = JOptionPane.showInputDialog(null, "Enter the number in the tenths place: " + number.StartingNumber());
	        int enterednumber = Integer.parseInt(ans);
	        if (enterednumber == number.tenths()){
		        JOptionPane.showMessageDialog(null, "Your answer is correct");
	        }else{
			    JOptionPane.showMessageDialog(null, "Your answer is wrong. The correct answer is: " + number.tenths());
	        }}
	    	
	    if (input == "hundredths"){
		    String ans2;
		        ans2 = JOptionPane.showInputDialog(null, "Enter the number in the hundredths place: " + number.StartingNumber());
		        int enterednumber2 = Integer.parseInt(ans2);
		        if (enterednumber2 == number.hundredths()){
			        JOptionPane.showMessageDialog(null, "Your answer is correct");
		        }else{
				    JOptionPane.showMessageDialog(null, "Your answer is wrong. The correct answer is: " + number.hundredths());
		        }}
	    if (input == "thousandths"){
		    String ans3;
		        ans3 = JOptionPane.showInputDialog(null, "Enter the number in the thousandths place: " + number.StartingNumber());
		        int enterednumber3 = Integer.parseInt(ans3);
		        if (enterednumber3 == number.thousandths()){
			        JOptionPane.showMessageDialog(null, "Your answer is correct");
		        }else{
				    JOptionPane.showMessageDialog(null, "Your answer is wrong. The correct answer is: " + number.thousandths());
		        }}
	    if (input == "ten-thousandths"){
		    String ans4;
		        ans4 = JOptionPane.showInputDialog(null, "Enter the number in the ten-thousandths place: " + number.StartingNumber());
		        int enterednumber4 = Integer.parseInt(ans4);
		        if (enterednumber4 == number.tenthousandths()){
			        JOptionPane.showMessageDialog(null, "Your answer is correct");
		        }else{
				    JOptionPane.showMessageDialog(null, "Your answer is wrong. The correct answer is: " + number.tenthousandths());
		        }
		        }
	}
	}

